﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="MantenedorProductos.aspx.cs" Inherits="Mantenedores_MantenedorProductos" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="contenido" Runat="Server">
    <asp:Panel ID="pnlMantenedorProductos" runat="server" Width="100%" GroupingText="Mantenedor de productos">
    <table border="0">
        <tr>
            <td align="right">
                Codigo:</td>
            <td style="text-align: left">
                <asp:TextBox ID="txbCodigo" runat="server"></asp:TextBox></td>
            <td style="text-align: left">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txbCodigo"
                    ErrorMessage="*" ValidationGroup="ValidaCampos"></asp:RequiredFieldValidator></td>
            <td align="right" style="color: #000000">
                Nombre :</td>
            <td align="left">
                <asp:TextBox ID="txbNombre" runat="server"></asp:TextBox></td>
            <td align="right" style="text-align: left">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txbNombre"
                    ErrorMessage="*" ValidationGroup="ValidaCampos"></asp:RequiredFieldValidator></td>
            <td align="right">
                Codigo de Barras :</td>
            <td align="right">
                <asp:TextBox ID="txbCodigoDeBarras" runat="server"></asp:TextBox></td>
            <td align="left">
            </td>
        </tr>
        <tr>
            <td align="right">
                Familia :</td>
            <td style="text-align: left">
                <asp:DropDownList ID="ddlFamilia" runat="server" DataSourceID="odsFamiliasDePRoducto"
                    DataTextField="Nombre" DataValueField="Id">
                </asp:DropDownList></td>
            <td style="text-align: left">
            </td>
            <td align="right" style="color: #000000">
                Medida :</td>
            <td align="left">
                <asp:DropDownList ID="ddlMedida" runat="server" DataSourceID="odsUnidadesDeMedida"
                    DataTextField="Codigo" DataValueField="Id">
                </asp:DropDownList></td>
            <td align="right">
            </td>
            <td align="right">
            </td>
            <td align="right">
            </td>
            <td align="left">
            </td>
        </tr>
        <tr>
            <td align="right">
                Descripcion :</td>
            <td align="left" colspan="4" rowspan="3">
                <asp:TextBox ID="txbDescripcion" runat="server" Height="100%" Rows="3" TextMode="MultiLine"
                    Width="100%"></asp:TextBox></td>
            <td align="right">
            </td>
            <td align="right">
                Stock Minimo :</td>
            <td align="right">
                <asp:TextBox ID="txbStockMinimo" runat="server" onChange="intOnly(this);" onKeyUp="intOnly(this);" onKeyPress="intOnly(this);"></asp:TextBox></td>
            <td align="left" style="text-align: left">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txbStockMinimo"
                    ErrorMessage="*" ValidationGroup="ValidaCampos"></asp:RequiredFieldValidator></td>
        </tr>
        <tr style="color: #000000">
            <td align="right">
            </td>
            <td align="right">
            </td>
            <td align="right">
                Stock Maximo :</td>
            <td align="right">
                <asp:TextBox ID="txbStockMaximo" runat="server" onChange="intOnly(this);" onKeyUp="intOnly(this);" onKeyPress="intOnly(this);"></asp:TextBox></td>
            <td align="left" style="text-align: left">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txbStockMaximo"
                    ErrorMessage="*" ValidationGroup="ValidaCampos"></asp:RequiredFieldValidator></td>
        </tr>
        <tr>
            <td align="right">
            </td>
            <td align="right">
            </td>
            <td align="right">
            </td>
            <td align="left">
            </td>
            <td align="left">
            </td>
        </tr>
        <tr>
            <td align="right">
            </td>
            <td colspan="3">
                </td>
            <td align="left">
            </td>
            <td align="center" colspan="1">
            </td>
            <td align="center" colspan="2">
                </td>
            <td align="center" colspan="1">
            </td>
        </tr>
        <tr>
            <td align="right">
            </td>
            <td align="left" colspan="3">
                <asp:ListBox ID="lbxProveedores" runat="server" Width="100%" DataSourceID="odsProveedoresDisponibles" DataTextField="RazonSocial" DataValueField="Id" SelectionMode="Multiple" Visible="False"></asp:ListBox></td>
            <td align="center" style="text-align: center" valign="middle">
                <asp:ImageButton ID="btnAgregar" runat="server" ImageUrl="~/img/addAll.gif" OnClick="btnAgregar_Click" Visible="False" /><br />
                &nbsp;
                <br />
                <asp:ImageButton ID="btnQuitar" runat="server" ImageUrl="~/img/removeAll.gif" OnClick="btnQuitar_Click" Visible="False" /><br />
                &nbsp;<br />
                </td>
            <td align="right" colspan="1">
            </td>
            <td align="right" colspan="2">
                <asp:ListBox ID="lbxProveedoresDelProducto" runat="server" Width="100%" SelectionMode="Multiple" Visible="False"></asp:ListBox></td>
            <td align="right" colspan="1">
            </td>
        </tr>
        <tr>
            <td align="right">
            </td>
            <td align="right" colspan="7" style="text-align: right">
        <asp:Button ID="btnAceptar" runat="server" CssClass="botonNuevo" OnClick="btnAceptar_Click"
            Text="Aceptar" ValidationGroup="ValidaCampos" /><asp:Button ID="btnNuevo" runat="server" CssClass="botonAceptar"
                OnClick="btnNuevo_Click" Text="Nuevo" /><asp:Button ID="btnModificar" runat="server" CssClass="botonModificar" OnClick="btnModificar_Click"
            Text="Modificar" /><asp:Button ID="btnEliminar" runat="server" CssClass="botonEliminar" OnClick="btnEliminar_Click"
            Text="Eliminar" /><asp:Button ID="btnCancelar" runat="server" CssClass="botonCancelar" OnClick="btnCancelar_Click"
            Text="Cancelar" /></td>
            <td align="right" colspan="1">
            </td>
        </tr>
        <tr>
            <td align="center" colspan="9" valign="middle">
                <hr />
                </td>
        </tr>
        <tr>
            <td align="right" colspan="8">
    <asp:GridView ID="gdvProductos" CssClass="GridViewStyle" runat="server" AllowPaging="True" AutoGenerateColumns="False"
        DataKeyNames="Id" DataSourceID="odsProductos" OnSelectedIndexChanged="gdvProductos_SelectedIndexChanged" Width="100%">
        <Columns>
            <asp:BoundField ItemStyle-HorizontalAlign="Left" DataField="Codigo" HeaderText="Codigo" SortExpression="Codigo" />
            <asp:BoundField ItemStyle-HorizontalAlign="Right" DataField="CodigoDeBarras" HeaderText="CodigoDeBarras" SortExpression="CodigoDeBarras" />
            <asp:BoundField ItemStyle-HorizontalAlign="Left" DataField="Nombre" HeaderText="Nombre" SortExpression="Nombre" />
            <asp:BoundField ItemStyle-HorizontalAlign="Right" DataField="StockMinimo" HeaderText="StockMinimo" SortExpression="StockMinimo" />
            <asp:BoundField ItemStyle-HorizontalAlign="Right" DataField="StockMaximo" HeaderText="StockMaximo" SortExpression="StockMaximo" />
            <asp:BoundField ItemStyle-HorizontalAlign="Left" DataField="Descripcion" HeaderText="Descripcion" SortExpression="Descripcion" />
            <asp:CommandField ShowSelectButton="True" />
        </Columns>
                <RowStyle CssClass="RowStyle" />
        <PagerStyle CssClass="PagerStyle" />
        <HeaderStyle CssClass="HeaderStyle" />
        <AlternatingRowStyle CssClass="AltRowStyle" />
        <SelectedRowStyle CssClass="SelectedRowStyle" />
    </asp:GridView>
            </td>
            <td align="right" colspan="1">
            </td>
        </tr>
    </table>
        <asp:Panel ID="Panel2" runat="server">
        <script language="javascript" type="text/javascript">
function intOnly(i) 
{
if(i.value.length>0) 
{
i.value = i.value.replace(/[^\d]+/g, ''); 
}
}
</script>
        </asp:Panel>
        <br />
    <asp:ObjectDataSource ID="odsProductos" runat="server" DataObjectTypeName="EYDIngenieria.ERP.ObjetosDeNegocio.Dominio.Producto"
        DeleteMethod="Eliminar" InsertMethod="Agregar" SelectMethod="Listar" TypeName="EYDIngenieria.ERP.Aplicacion.Mantenedores.MantenedorProducto"
        UpdateMethod="Modificar"></asp:ObjectDataSource><asp:ObjectDataSource ID="odsFamiliasDePRoducto" runat="server" DataObjectTypeName="EYDIngenieria.ERP.ObjetosDeNegocio.Dominio.FamiliaProducto"
        DeleteMethod="Eliminar" InsertMethod="Agregar" SelectMethod="Listar" TypeName="EYDIngenieria.ERP.Aplicacion.Mantenedores.MantenedorFamiliaProducto"
        UpdateMethod="Modificar"></asp:ObjectDataSource>
        <asp:ObjectDataSource ID="odsUnidadesDeMedida" runat="server" DataObjectTypeName="EYDIngenieria.ERP.ObjetosDeNegocio.Dominio.UnidadDeMedida"
        DeleteMethod="Eliminar" InsertMethod="Agregar" SelectMethod="Listar" TypeName="EYDIngenieria.ERP.Aplicacion.Mantenedores.MantenedorUnidadDeMedida"
        UpdateMethod="Modificar"></asp:ObjectDataSource>
        <asp:ObjectDataSource ID="odsProveedoresDisponibles" runat="server" DataObjectTypeName="EYDIngenieria.ERP.ObjetosDeNegocio.Dominio.Proveedor"
        DeleteMethod="Eliminar" InsertMethod="Agregar" SelectMethod="Listar" TypeName="EYDIngenieria.ERP.Aplicacion.Mantenedores.MantenedorProveedor"
        UpdateMethod="Modificar"></asp:ObjectDataSource>
        &nbsp;
        <br />
        <br />
        <br />
    </asp:Panel>
    &nbsp;
    &nbsp;&nbsp;
</asp:Content>

